1. Field of the Invention
This invention relates to caching in digital video processing apparatus.
2. Description of the Prior Art
In video processing apparatus, such as a video special effects apparatus, digital processing is applied to images of a video sequence.
In one example of such a system, the user can set up a composite special effect to be applied to a video sequence by selecting a succession of effects modules from a large number of available modules. For example, a sequence (or xe2x80x9cdirected acyclic graphxe2x80x9d) of effects set up by a user might comprise:
(i) image loader
(ii) motion tracker
(iii) lighting effect linked to motion tracking and image loader
(iv) image realignment linked to motion tracking and image loader.
Once a particular effect has been selected and all the parameters defined, a xe2x80x9crenderingxe2x80x9d operation has to take place. Rendering is the process of generating an output image, a series of images forming an output video sequence or an intermediate data type such as a motion vector or a position within an image, according to the processing operation which has been set up. For example, a lighting effect might involve the user selecting a source and a destination position for a computer-generated spotlight to be applied to a video sequence. Once these positions have been defined, the next task is to render each image in the output sequence by applying the defined lighting effect to determine the colour and luminance of each pixel of each output image.
With current processing systems, rendering can be very time consuming, typically taking between a few seconds and many hours (depending on the sequence length) to render each image of a video sequence. To alleviate the delays experienced by a user, the processing parameters and the results (rendered images or other result data such as a motion vector in the case of a motion tracking effect) for some or all of the processing operations in the composite effects are cached.
A main reason for caching the results is that if an effect at a particular position in the directed acyclic graph is alteredxe2x80x94for example, a parameter changexe2x80x94the results of preceding effects in the directed acyclic graph can then be re-used directly from the cache when the changed effect has to be re-rendered.
This also enables an operation to be xe2x80x9cundonexe2x80x9d very quicklyxe2x80x94for example if a user tries a new set of parameters, does not like the result, and so desires to return to the previous working state of the apparatus before the latest change was made. Instead of re-entering the processing parameters and the apparatus re-rendering the resulting images, they can instead be retrieved quickly from the cache.
Because the cache has a finite capacity, from time to time the cache has to be cleared to make room available for new items to be cached. Generally, the least recently used items in the cache are discarded.
This invention provides video processing apparatus in which successive video processing operations are applied to images of a video signal to generate corresponding processing results in the form of images or data, the apparatus comprising:
a cache store for storing, as cached items and processing results associated with the video processing operations; and
means for deleting currently cached items to provide cache space for items to be newly cached, the deleting means operating so that non-image processing results are retained in the cache for longer than processing results in the form of images.
The invention recognises that of the three classes of data referred to above, namely parameter data, image data and non-image result data (e.g. a motion vector), the image data generally occupies vastly more cache space than data in the other two classes. However, non-image result data can still take a long time to render, and so is worth retaining in the cache.
Accordingly, in the invention, non-image result data is retained preferentially over image result data. This non-image result data is therefore available from the cache for a longer period, at the expense of just a small amount of cache storage in comparison with the space required to cache an image. Indeed, it is preferred that non-image result data is never flushed from the cachexe2x80x94at least, during a particular operating session of the apparatus.